//
//  DLW_PlayMusic.h
//  27-homework-AVAudioPlay
//
//  Created by 王道林 on 16/8/21.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import <Foundation/Foundation.h>

@class AVPlayer, AVPlayerItem;

@protocol DLW_PlayMusicDelegate <NSObject>

- (void)musicPlayWithProgress:(float)progress during:(float)during; // 获取播放进度
- (void)musicPlayFinished;  // 播放结束

@end
@interface DLW_PlayMusic : NSObject

@property (nonatomic, assign) id<DLW_PlayMusicDelegate> delegate;
@property (nonatomic, assign) float during;
@property (nonatomic, retain) AVPlayer *player;
@property (nonatomic, retain) AVPlayerItem *songItem;
@property (nonatomic, retain) NSString *currentUrlStr;
// 是否可以播放
@property (nonatomic, assign) BOOL isReady;
// 播放器是否正在播放
@property (nonatomic, assign) BOOL isPlay;
// 网址
@property (nonatomic, retain) NSString *urlStr;



+ (instancetype)sharePlayMusic;
- (float)during;

- (void)playSong;

- (void)pauseSong;

- (void)stopSong;

- (void)sliderToTimer:(float)time;

@end
